Skip to content

Conversation

@clydin
Copy link
Member

@clydin clydin commented Nov 14, 2025

Align Vitest's module resolution with the development server to ensure consistent behavior. This change configures Vitest to prioritize ESM-optimized package entry points by setting 'es2020', 'module', and 'main' as main fields and 'es2015', 'es2020', and 'module' as conditions during module resolution. This improves compatibility and performance by utilizing modern JavaScript module formats where available.

Closes #31808

…ading

Align Vitest's module resolution with the development server to ensure consistent behavior.
This change configures Vitest to prioritize ESM-optimized package entry points by
setting 'es2020', 'module', and 'main' as main fields and 'es2015', 'es2020', and 'module'
as conditions during module resolution. This improves compatibility and performance
by utilizing modern JavaScript module formats where available.
@clydin clydin added the target: rc This PR is targeted for the next release-candidate label Nov 14, 2025
include: options.optimizeDepsInclude,
},
resolve: {
mainFields: ['es2020', 'module', 'main'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that this contains some values that could change over time (e.g. es2020), can we decrease the risk of getting out of sync somehow?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are there for older APF packages. We stopped using that in newer APF revisions. It's just default now with a single code variant.

@clydin clydin added the action: merge The PR is ready for merge by the caretaker label Nov 14, 2025
@clydin clydin merged commit 9b5a452 into angular:main Nov 14, 2025
81 of 84 checks passed
@clydin
Copy link
Member Author

clydin commented Nov 14, 2025

This PR was merged into the repository. The changes were merged into the following branches:

@clydin clydin deleted the unit-test/vitest-resolve branch November 14, 2025 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build target: rc This PR is targeted for the next release-candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rc.3 vitest browser mode issue with tslib

2 participants